package com.cosina.game.crystallight.ui.battle.drawable;

import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Rect;

import com.cosina.game.crystallight.engine.BattleEngine;
import com.cosina.game.crystallight.engine.Architect;
import com.cosina.game.crystallight.ui.battle.drawadapter.BaseDrawable;
import com.cosina.game.crystallight.ui.common.PaintSuite;

public class BuildingDrawable extends BaseDrawable {

	@Override
	public void draw(Canvas canvas) {
		int[][] mapInfo = BattleEngine.architect.getBuildingMap();
		for(int y=0; y<mapInfo.length; y++){
			for(int x=0; x<mapInfo[0].length; x++) {
				
				tileRect.offsetTo(x*44 + 5, y*44 + 5);
				Paint usePaint = PaintSuite.paintForGreen;
				if(mapInfo[y][x] == Architect.red){
					usePaint = PaintSuite.paintForRed;
				}
				canvas.drawRect(tileRect, usePaint);
			}
		}
	}
	
	private final Rect tileRect = new Rect(0,0,44,44);
}
